package com.example.spring.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * 用户实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserBean {
    private String name;
    private String email;

    // 密码字段的内容不被toString显示
    @ToString.Exclude
    // 密码字段不参与Json序列化,但允许反序列化
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String password;
}
